package com.xxgc.spring.service.impl;

import com.xxgc.spring.dao.UserDaoMapper;
import com.xxgc.spring.dao.impl.UserDao;
import com.xxgc.spring.service.IUserLoginService;

public class UserLoginService implements IUserLoginService{
    //和Dao层建立关系通道
    private UserDaoMapper udm;
    //构造方法注入
    /*public void setUdm(UserDaoMapper udm){
        this.udm = udm;
    }*/
    public UserLoginService(UserDaoMapper udm){
        this.udm = udm;
    }

    public UserLoginService(){
        System.out.println("我是小宋，我破壳了");
    }

    public int userLogin(String uName, String uPass) {

        udm.selectUserById();
        if("zs".equals(uName) && "123456".equals(uPass)){
            System.out.println("登录成功");
        }else{
            System.out.println("对不起，你的用户名或密码错误");
        }
        return 0;
    }

    public int userRegister(String uName, String uPass) {
        return 0;
    }
}
